<?php $this->load->view('admin/common/pageHead');?>
<?php $this->load->view('admin/common/pageHeader');?>

<div class="fLeft">
	<?php $this->load->view('admin/common/left_nav'); ?>
</div>
<div class="fRight" style="margin: 20px 200px 0px 0px">
	<form name="form1" action="/updateEvent" method="post"
		onSubmit="return addEvent();">
		<input type="hidden" value="<?php echo $oneEvent["event_id"]; ?>"
			id="eventId" name="eventId" />
		<table
			style="border-color: #EAC8B3; border-left: 1px solid #EAC8B3; border-right: 1px solid #EAC8B3; border-style: solid; border-width: 1px;"
			align="center">



			<tr>
				<td colspan="3" class="fotter-color" align="center"><b>Edit Event</b>
				</td>
			</tr>
			<tr>
				<td colspan="3" class="style2" align="left"><input name="events"
					value="Update" type="hidden">
					<table border="0" cellpadding="0" cellspacing="0" height="25"
						width="500" align="center">
						<tr height="40px">
							<td class="tdclass" width="250">Event Name:<span
								style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
							</td>
							<td><input name="eventName" class="form_input" id="eventName"
								size="22" value="<?php echo $oneEvent["event_name"]; ?>"
								type="text"></td>
						</tr>
						<tr height="40px">
							<td class="tdclass" width="150">Event Address:<span
								style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
							</td>
							<td><input name="eventAdd" class="form_input" id="eventAdd"
								size="22" value="<?php echo $oneEvent["event_address"]; ?>"
								type="text"></td>
						</tr>
						<tr height="40px">
							<td class="tdclass" width="150">Event Start Date:<span
								style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
							</td>
							<td><input name="eventStartDate" class="form_input"
								id="eventStartDate" size="22"
								value="<?php echo $oneEvent["event_start_date"]; ?>" type="text"
								readonly></td>
						</tr>
						<tr height="40px">
							<td class="tdclass" width="150">Event End Date:<span
								style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
							</td>
							<td><input name="eventEndDate" class="form_input"
								id="eventEndDate" size="22"
								value="<?php echo $oneEvent["event_end_date"]; ?>" type="text"
								readonly></td>
						</tr>
						<tr height="40px">
							<td class="tdclass" width="150">Event Start Time:<span
								style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
							</td>
							<!--<td><input name="eventStartT" class="form_input" id="eventStartT" size="18" value="" type="text"></td>-->
							<td valign="middle"><select name="eventStarthour"
								class="form_input" id="eventStarthour">
									<option value="">Hour</option>
									<? for ($i = 0; $i <= 12; $i++) { ?>
									<?php if(strlen($i)==1){?>
									<option
									<?if(substr($oneEvent["event_start_time"], 0, 2)=='0'.$i){ echo 'Selected';} ?>
										value="<?= '0'.$i; ?>">
										<?= '0'.$i; ?>
									</option>
									<?php } else{?>
									<option
									<?if(substr($oneEvent["event_start_time"], 0, 2)==$i){ echo 'Selected';} ?>
										value="<?= $i; ?>">
										<?= $i; ?>
									</option>
									<? } 
}?>
							</select> &nbsp;&nbsp; <select name="eventStartMinute"
								class="form_input" id="eventStartMinute">
									<option value="">Minute</option>
									<? for ($i = 0; $i <= 60; $i=$i+5) {?>
									<?php if($i==0 || $i==5){?>
									<option
									<?if(substr($oneEvent["event_start_time"], 3, -3)=='0'.$i){ echo 'Selected';} ?>
										value="<?= '0'.$i; ?>">
										<?= '0'.$i; ?>
									</option>
									<?php } else{ ?>
									<option
									<?if(substr($oneEvent["event_start_time"], 3, -3)==$i){ echo 'Selected';} ?>
										value="<?= $i; ?>">
										<?= $i; ?>
									</option>
									<? } 
}?>
							</select> &nbsp;&nbsp; <select name="eventStartType"
								class="form_input" id="eventStartType">
									<option
									<?if(substr($oneEvent["event_start_time"], -2)=='AM'){ echo 'Selected';} ?>
										value="AM">AM</option>
									<option
									<?if(substr($oneEvent["event_start_time"], -2)=='PM'){ echo 'Selected';} ?>
										value="PM">PM</option>
							</select>
							</td>
						</tr>
						<tr height="40px">
							<td class="tdclass" width="150">Event End Time:<span
								style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
							</td>
							<!--<td><input name="eventEndT" class="form_input" id="eventEndT" size="18" value="" type="text"></td>-->
							<td valign="middle"><select name="eventEndhour"
								class="form_input" id="eventEndhour">
									<option value="">Hour</option>
									<? for ($i = 0; $i <= 12; $i++) { ?>
									<?php if(strlen($i)==1){?>
									<option
									<?if(substr($oneEvent["event_end_time"], 0, 2)=='0'.$i){ echo 'Selected';} ?>
										value="<?= '0'.$i; ?>">
										<?= '0'.$i; ?>
									</option>
									<?php } else{?>
									<option
									<?if(substr($oneEvent["event_end_time"], 0, 2)==$i){ echo 'Selected';} ?>
										value="<?= $i; ?>">
										<?= $i; ?>
									</option>
									<? } 
}?>
							</select> &nbsp;&nbsp; <select name="eventEndMinute"
								class="form_input" id="eventEndMinute">
									<option value="">Minute</option>
									<? for ($i = 0; $i <= 60; $i=$i+5) {?>
									<?php if($i==0 || $i==5){?>
									<option
									<?if(substr($oneEvent["event_end_time"], 3, -3)=='0'.$i){ echo 'Selected';} ?>
										value="<?= '0'.$i; ?>">
										<?= '0'.$i; ?>
									</option>
									<?php } else{ ?>
									<option
									<?if(substr($oneEvent["event_end_time"], 3, -3)==$i){ echo 'Selected';} ?>
										value="<?= $i; ?>">
										<?= $i; ?>
									</option>
									<? } 
}?>
							</select> &nbsp;&nbsp; <select name="eventEndtype"
								class="form_input" id="eventEndtype">
									<option
									<?if(substr($oneEvent["event_end_time"], -2)=='AM'){ echo 'Selected';} ?>
										value="AM">AM</option>
									<option
									<?if(substr($oneEvent["event_end_time"], -2)=='PM'){ echo 'Selected';} ?>
										value="PM">PM</option>
							</select>
							</td>
						
						
						<tr height="40px">
							<td class="tdclass" width="150">Event Status:<span
								style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
							</td>
							<td><select name="eventStatus" class="form_input"
								id="eventStatus">
									<option
									<?if(substr($oneEvent["event_status"], -2)=='Yes'){ echo 'Selected';} ?>
										value="Yes">Yes</option>
									<option
									<?if(substr($oneEvent["event_status"], -2)=='No'){ echo 'Selected';} ?>
										value="No">No</option>
							</select></td>
						</tr>
						</tr>

						<tr>
							<td class="tdclass" colspan="2" width="150"></td>
						</tr>

						<tr>
							<td class="tdclass" colspan="2" width="150"></td>
						</tr>
						<tr>
							<td class="tdclass" colspan="2" width="150"></td>
						</tr>
						<tr>
							<td colspan="10" height="58" align="center"><input name="update"
								class="form_input" id="update" value="UPDATE" type="submit">&nbsp;<input
								value="RESET" class="" onclick="javascript:history.back();"
								type="reset">
							</td>
						</tr>
					</table>

					</form>
				</td>
			</tr>
			</tbody>
		</table>

</div>
<div class="clr"></div>
</br>
<link rel="stylesheet"
	type="text/css" media="all" href="/public/calendar/jsDatePick.css" />
<script
	type="text/javascript" src="/public/calendar/jsDatePick.full.1.1.js"></script>
<script type="text/javascript">
                        window.onload = function() {
                            new JsDatePick({
                                useMode: 2,
                                target: "eventStartDate"
                                        //limitToToday:true <-- Add this should you want to limit the calendar until today.
                            });

                            new JsDatePick({
                                useMode: 2,
                                target: "eventEndDate"
                                        //limitToToday:true <-- Add this should you want to limit the calendar until today.
                            });
                        };
</script>
<script type="text/javascript">
    function addEvent()
    {
        if (document.form1.eventName.value == '')
        {
            alert("Please Add a Event Name ");
            document.form1.eventName.focus();
            return false;
        }
        if (document.form1.eventAdd.value == '')
        {
            alert("Please Add a Event Address ");
            document.form1.eventAdd.focus();
            return false;
        }
        if (document.form1.eventStartDate.value == '')
        {
            alert("Please Add a Event Start Date");
            document.form1.eventStartDate.focus();
            return false;
        }
        if (document.form1.eventEndDate.value == '')
        {
            alert("Please Add a Event End Date ");
            document.form1.eventEndDate.focus();
            return false;
        }
        if (document.form1.eventStarthour.value == '')
        {
            alert("Please Select Start Hour ");
            document.form1.eventStarthour.focus();
            return false;
        }
        if (document.form1.eventStartMinute.value == '')
        {
            alert("Please Select Start Minute ");
            document.form1.eventStartMinute.focus();
            return false;
        }
        if (document.form1.eventStartType.value == '')
        {
            alert("Please Select AM or PM ");
            document.form1.eventStartType.focus();
            return false;
        }
        if (document.form1.eventEndhour.value == '')
        {
            alert("Please Select End Hour ");
            document.form1.eventEndhour.focus();
            return false;
        }
        if (document.form1.eventEndMinute.value == '')
        {
            alert("Please Select End Minute ");
            document.form1.eventEndMinute.focus();
            return false;
        }
        
        if (document.form1.eventEndType.value == '')
        {
            alert("Please Select AM or PM ");
            document.form1.eventEndType.focus();
            return false;
        }
        if (document.form1.eventStatus.value == '')
        {
            alert("Please Select Status ");
            document.form1.eventStatus.focus();
            return false;
        }    
        
    }
</script>
<?php $this->load->view('admin/common/pageFooter'); ?>